# encoding:utf-8
import numpy as np

# 定义一个简单的函数f(x, y)
def f(x, y):
    return x**2 + y**2

# 定义一个梯度下降算法，更新x和y的值
def gradient_descent(x, y, learning_rate, num_iterations):
    for _ in range(num_iterations):
        gradient = np.array([2*x, 2*y])
        x = x - learning_rate * gradient[0]
        y = y - learning_rate * gradient[1]
    return x, y

# 初始化x和y的值
x = np.random.randn()
y = np.random.randn()

# 设置学习率
learning_rate = 0.1

# 迭代次数
num_iterations = 100

# 进行梯度下降算法
x, y = gradient_descent(x, y, learning_rate, num_iterations)

# 输出最终的结果
print("最大值位于：", x, y)
